package com.zsf.serviceImp;

import org.apache.ibatis.session.SqlSession;

import com.zsf.dao.UserDao;
import com.zsf.pojo.User;
import com.zsf.service.UserService;
import com.zsf.util.MyBatiseUtil;

public class UserServiceImp implements UserService {

	public User getUserByAP(User user) {
		SqlSession session=MyBatiseUtil.getSession();
		User userN =session.getMapper(UserDao.class).selectByAP(user);
		MyBatiseUtil.close(session);
		return userN;
	}

	public int getUserExitst(User user) {
		SqlSession session=MyBatiseUtil.getSession();
		int count =session.getMapper(UserDao.class).selectByAll(user);
		MyBatiseUtil.close(session);
		return count;
	}

	public void insertUser(User user) {
		SqlSession session=MyBatiseUtil.getSession();
		int count =session.getMapper(UserDao.class).insert(user);
		MyBatiseUtil.close(session);
		
	}

}
